home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-04-13 | 956 b | 51 lines | [TEXT/ttxt] |
- -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C)
- -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
- --
- deferred class BENCH
- --
- -- Comparison : `add_first' for ARRAY, FIXED_ARRAY, LINK_LIST
- -- and LINK2_LIST.
- --
-
- feature
-
- -- According to the power of your computer, set `tuning'
- -- to a good positive value. Default is for very small
- -- computer :
- tuning: INTEGER is 1; -- 6000;
-
- feature {NONE}
-
- frozen bench(cltn: COLLECTION[INTEGER]) is
- require
- cltn.count = 0
- local
- i: INTEGER;
- do
- from
- i := tuning + 5;
- until
- i = 0
- loop
- cltn.add_first(i);
- check
- cltn.item(cltn.lower) = i
- end;
- i := i - 1;
- end;
- debug
- from
- i := cltn.upper - 1;
- until
- i < cltn.lower
- loop
- check
- cltn.item(i) = cltn.item(i + 1) - 1
- end;
- i := i - 1;
- end;
- end;
- end;
-
- end
-